<?php

namespace app\modules\api\controllers;

use ac\controllers\BasicController;
use app\models\Config;
use ac\component\tool\Tool;
use ac\component\exception\ErrMap;


class ConfigController extends BasicController
{
    /*配置*/
    public function actionIndex()
    {
        /*取出单个数据*/
        $config = Config::find()->asArray()->one();
        // P($config);
        if(!is_null($config)){
            if(!empty($config['company_logo'])){
                $config['company_logo'] = explode(',', $config['company_logo']);
            }
            // P($config);
            return Tool::showRes([0, '获取成功'], $config);
        }else{
            return Tool::showRes(ErrMap::getError(10010));
        };
        
    }

}
